package org.esprit.ocm.client.rpc.oca;

import java.util.List;

import org.esprit.ocm.model.oca.VmOca;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("VMOcaService.rpc")
public interface VMOcaService extends RemoteService {

	/**
	 * List All vms
	 * 
	 * @param client
	 * @return
	 * @throws Exception
	 */
	public List<VmOca> listAll(String secret, String endpoint, int filter) throws Exception;

	/**
	 * Create New VM
	 * 
	 * @param client
	 * @param template
	 * @param image
	 * @return
	 * @throws Exception
	 */
	public String allocate(String secret, String endpoint, String template) throws Exception;

	/**
	 * Delete VM
	 * 
	 * @param client
	 * @param imgId
	 * @throws Exception
	 */
	public String delete(String secret, String endpoint, int vmId) throws Exception;
	
	/**
	 * Describe vm information
	 * 
	 * @param client
	 * @param vnetId
	 * @return
	 * @throws Exception
	 */
	public VmOca info(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String hold(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String release(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @param hostId
	 * @throws Exception
	 */
	public String deploy(String secret, String endpoint, int vmId, int hostId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @param hostId
	 * @throws Exception
	 */
	public String migrate(String secret, String endpoint, int vmId, int hostId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @param hostId
	 * @throws Exception
	 */
	public String liveMigrate(String secret, String endpoint, int vmId, int hostId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String shutdown(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String cancel(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String stop(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String suspend(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String resume(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @throws Exception
	 */
	public String finalize(String secret, String endpoint, int vmId) throws Exception;

	/**
	 * 
	 * @param client
	 * @param vmId
	 * @return 
	 * @throws Exception
	 */
	public String restart(String secret, String endpoint, int vmId) throws Exception;
}
